package nowcoder.day_48.day15;

import java.util.Scanner;

//HJ62 查找输入整数二进制中1的个数
public class Num1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()){
            int n = in.nextInt();
            System.out.println(Count(n));
        }
    }
    public static int Count (int n){
        int count = 0;
        while (n != 0){
            n &= (n - 1);
            count++;
        }
        return count;
    }
}
